;Assembler header file for URI
;written by DefMod (Dec 31 2005) on Sat Dec 31 14:11:43 2005
;Tom Hughes, tom@compton.nu, 27 Mar 1999

        [       :LNOT: :DEF: URI_Hdr
        GBLS    URI_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

        [       :LNOT: :DEF: Get_Wimp
        GBLS    Get_Wimp
        ]
        [       :LNOT: :DEF: Wimp_Hdr
Get_Wimp                        SETS    "GET oslib/Wimp.Hdr"
        |
Get_Wimp                        SETS    ""
        ]
        $Get_Wimp

;Symbols for constants
URI_FileType                    *       &F91
Message_URIHandlerStarted       *       &4E380
Message_URIHandlerDying         *       &4E381
Message_URIProcess              *       &4E382
Message_URIReturnResult         *       &4E383
Message_URIProcessAck           *       &4E384
URI_ProcessCheckOnly            *       &1
URI_ReturnResultNotClaimed      *       &1
URI_DispatchInformCaller        *       &1
URI_DispatchCheckOnly           *       &2
URI_DispatchNoExternalStartup   *       &4
URI_DispatchRequestRejected     *       &1
Error_URINoMemory               *       &810A01
Error_URIBadURI                 *       &810A02
Error_URIBadHandle              *       &810A03
Error_URIBadFile                *       &810A04

;Symbols for structure offsets and sizes
URI_H                           *       4 ;abstract type
                                ^       0
                                #       Bits
URI_ProcessFlags                *       @

                                ^       0
                                #       Bits
URI_ReturnResultFlags           *       @

                                ^       0
URI_MessageHandlerStarted_flags #       Bits
URI_MessageHandlerStarted       *       @

                                ^       0
URI_MessageHandlerDying_flags   #       Bits
URI_MessageHandlerDying         *       @

                                ^       0
URI_MessageProcess_flags        #       URI_ProcessFlags
URI_MessageProcess_uri          #       Ptr
URI_MessageProcess_handle       #       URI_H
URI_MessageProcess              *       @

                                ^       0
URI_MessageReturnResult_flags   #       URI_ReturnResultFlags
URI_MessageReturnResult_handle  #       URI_H
URI_MessageReturnResult         *       @

                                ^       0
URI_MessageProcessAck_flags     #       URI_ProcessFlags
URI_MessageProcessAck_uri       #       Ptr
URI_MessageProcessAck_handle    #       URI_H
URI_MessageProcessAck           *       @

                                ^       0
URI_FullMessageHandlerStarted   Wimp_MessageHeader_MEMBERS
URI_FullMessageHandlerStarted_flags #       Bits
URI_FullMessageHandlerStarted   *       @

                                ^       0
URI_FullMessageHandlerDying     Wimp_MessageHeader_MEMBERS
URI_FullMessageHandlerDying_flags #       Bits
URI_FullMessageHandlerDying     *       @

                                ^       0
URI_FullMessageProcess          Wimp_MessageHeader_MEMBERS
URI_FullMessageProcess_flags    #       URI_ProcessFlags
URI_FullMessageProcess_uri      #       Ptr
URI_FullMessageProcess_handle   #       URI_H
URI_FullMessageProcess          *       @

                                ^       0
URI_FullMessageReturnResult     Wimp_MessageHeader_MEMBERS
URI_FullMessageReturnResult_flags #       URI_ReturnResultFlags
URI_FullMessageReturnResult_handle #       URI_H
URI_FullMessageReturnResult     *       @

                                ^       0
URI_FullMessageProcessAck       Wimp_MessageHeader_MEMBERS
URI_FullMessageProcessAck_flags #       URI_ProcessFlags
URI_FullMessageProcessAck_uri   #       Ptr
URI_FullMessageProcessAck_handle #       URI_H
URI_FullMessageProcessAck       *       @

                                ^       0
                                #       Bits
URI_DispatchFlags               *       @

                                ^       0
                                #       Bits
URI_DispatchResultFlags         *       @


;Symbols for SWI's and SWI reason codes
XURI_Version                    *       &6E380
URI_Version                     *       &4E380
   ;Entry
   ;  R0 = flags (Bits)
   ;Exit
   ;  R0 = version (Int)

XURI_Dispatch                   *       &6E381
URI_Dispatch                    *       &4E381
   ;Entry
   ;  R0 = flags (URI_DispatchFlags)
   ;  R1 -> uri (String)
   ;  R2 = source_task (Wimp_T)
   ;Exit
   ;  R0 = flags_out (URI_DispatchResultFlags)
   ;  R2 = handler_task (Wimp_T)
   ;  R3 = handle (URI_H)

XURI_RequestURISize             *       &6E382
URI_RequestURISize              *       &4E382
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = &0
   ;  R3 = handle (URI_H)
   ;Exit
   ;  R2 = buffer_size (Int)

XURI_RequestURI                 *       &6E382
URI_RequestURI                  *       &4E382
   ;Entry
   ;  R0 = flags (Bits)
   ;  R1 = buffer (pointer to String)
   ;  R2 = buffer_size (Int)
   ;  R3 = handle (URI_H)
   ;Exit
   ;  R2 = length (Int)

XURI_InvalidateURI              *       &6E383
URI_InvalidateURI               *       &4E383
   ;Entry
   ;  R0 = flags (Bits)
   ;  R3 = handle (URI_H)

Service_URI                     *       &A7

Service_URIHandlerStarted       *       &0
   ;Entry
   ;  R0 = &0
   ;  R1 = &A7

Service_URIHandlerDying         *       &1
   ;Entry
   ;  R0 = &1
   ;  R1 = &A7

Service_URIProcess              *       &2
   ;Entry
   ;  R0 = &2
   ;  R1 = &A7
   ;  R2 = flags (URI_ProcessFlags)
   ;  R3 -> uri (String)
   ;  R4 = handle (URI_H)
   ;Exit
   ;  R1 = unclaimed (Bool)

Service_URIReturnResult         *       &3
   ;Entry
   ;  R0 = &3
   ;  R1 = &A7
   ;  R2 = flags (URI_ReturnResultFlags)
   ;  R3 = &0
   ;  R4 = handle (URI_H)
   ;Exit
   ;  R1 = unclaimed (Bool)

        ]
        END
